package org.jcc.servlet.encoding.page.writer;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/encoding/page/printwriter/utf8")
public class EncodingPrintWriterUTF8 extends HttpServlet {

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setCharacterEncoding("utf-8");
		PrintWriter pw = response.getWriter();
		String header = "<html><head><meta charset='utf-8'></head><body>";
		String footer = "</body></html>";
		pw.write(header + "utf-8 字符流" + footer);
	}
	
	private static final long serialVersionUID = 1L;
}
